home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 37
/
Aminet 37 (2000)(Schatztruhe)[!][Jun 2000].iso
/
Aminet
/
dev
/
lang
/
sofa.lha
/
sofa
/
smalleiffel
/
lib_show
/
cecil
/
example2
/
example.e
< prev
next >
Wrap
Text File
|
2000-03-25
|
994b
|
52 lines
class EXAMPLE
--
-- The Eiffel program is running first, then call the C program
-- which is in charge to call the Eiffel feature `show_values' of
-- this EXAMPLE class.
--
-- To compile this example, use command :
--
-- compile -cecil cecil.se example c_prog.c
--
-- Is is also possible to do :
--
-- gcc -c c_prog.o
-- compile -cecil cecil.se example c_prog.o
--
creation make
feature
make is
do
values := <<1,2,3>>;
call_c_prog(Current);
end;
show_values is
local
i: INTEGER;
do
from
i := values.lower;
until
i > values.upper
loop
io.put_integer(values.item(i));
io.put_new_line;
i := i + 1;
end;
end;
feature {NONE}
values: ARRAY[INTEGER];
call_c_prog(current_object: like Current) is
external "C"
alias "c_prog"
end;
end -- EXAMPLE